<template>
	<div>
		<el-tabs v-model="activeName" @tab-click="handleTabChange">
			<el-tab-pane v-for="(item, index) in tabsList" :key="index" :label="item.label" :name="item.value"></el-tab-pane>
			<div class="content-card">
				<component
					class="pd10"
					:is="whickComm[activeName]"
					@refresh="handleRefresh"
					:nowRowData="nowRowData"
					:actionBtn="false"
					:searchConfig="false"
					:key="activeName"
					:isWithAuth="0"
					:showBtn="showBtn"
				></component>
			</div>
		</el-tabs>
	</div>
</template>

<script setup lang="ts">

import apiMod from '@/apiMod'
import { useCommonStore } from '@/stores/common'
import { useOperate } from '@/views/datacenter/hooks/useConfig'
import bus from '@/utils/eventbus'
import { getAreaObj } from '@/utils/util'
import BaseInfo from "./baseInfo/index.vue"
import Maintenance from "./maintenance/index.vue"
// 打卡记录


const { setTempParams, setMoreSearch, setLoading, setGloabnowRowData, setDetailHeadData } = useCommonStore()
const { onDelete, onMessageChange } = useOperate(1)

const whickComm = {
	BaseInfo:BaseInfo,
    Maintenance:Maintenance
}
type Props = {
	nowRowData?: any
	showBtn?:boolean // 显示按钮
}
const props = withDefaults(defineProps<Props>(), {
	showBtn:true
})
const emit = defineEmits(['refresh', 'rechange'])

const activeLabelTitle = ref('基础信息')
const loading = ref(false)
const tabsList: any = [
	{ label: '基础信息', value: 'BaseInfo' },
	{ label: '维护信息', value: 'Maintenance'},
	
]
const activeName = ref('BaseInfo')
let nowData = ref({})
provide('nowRowData', nowData)

const handleRefresh = () => {
	emit('refresh')
}
const handleTabChange = (tab) => {
	activeLabelTitle.value = tab.props.label
}



onMounted(() => {
})
onUnmounted(() => {
	setMoreSearch({})
	setDetailHeadData(undefined)
})
</script>

<style scoped></style>
